<template>
  <div class="special-title">
    <h2>你喜欢的合集都在这里...</h2>
    <ul class="title">
      <router-link
        class="title-box"
        tag="li"
        :to="{name:'sapecialTitle',query: {objectId: item.objectId,topImg: item.image,topTitle : item.title},}"
        v-for="item in results"
        :key="item.order"
      >
        <div class="title-img" @click="getObjectId(item.objectId)">

          <img :src="item.image" />

          <div class="title-text">
            <span>{{ item.title }}</span>
          </div>
        </div>
      </router-link>
    </ul>

    <div class="dianzi">

    </div>
  </div>
</template>

<script>
import title from "./title.json";
export default {
  data() {
    return {
      results: title.results,
      specialId:0,
    };
  },
  components: {
    // SpecialTitleView,
  },
  methods: {
    getObjectId(id) {
      this.specialId = id
      return this.specialId
    },
  },
};
</script>

<style scoped>

.special-title {
  background-color: rgba(242, 238, 238, 0.742);
}

.special-title h2 {
  color: rgba(62, 173, 62, 0.731);
  font-size: 20px;
  font-weight: 700;
  text-align: left;
  margin-left: 20px;
  padding-top: 15px;
}

.title {
  display: flex;
  flex-wrap: wrap;
  width: 95vw;
  margin: 0 auto;
}

.title .title-box {
  margin: 15px 14px;
}

.title-img {
  width: 40vw;
  height: 240px;
  overflow: hidden;
  border-radius: 15px;
  position: relative;
}

.title-img img {
  position: absolute;
  left: -125px;
  height: 240px;
}

.title-text {
  position: absolute;
  bottom: 15px;
  width: 100%;
  height: 30%;
  background-color: rgb(227, 220, 220, 0.6);
}

.title-text span {
  display: inline-block;
  color: #fff;
  font-size: 1rem;
  line-height: 28px;
  margin: 10px 15px;
  text-align: left;
  width: 80%;
}

.dianzi {
  height: 50px;
}
</style>